/**
 * Learning Backbone -> Syncing Models with Views
 * 
 * @author: MPeg [marco(dot)pegoraro(at)gmail(dot)com]
 * 
 * This view listen for the form to be submitted and updates the model with form
 * data.
 * 
 */

define([ 'backbone', 'jquery'

], function(Backbone, $

) {

	return Backbone.View.extend({

		events : {
			"submit" : "onSubmit"
		},

		onSubmit : function(e) {

			e.preventDefault();

			this.model.set({
				font : this.$('input[name=font]').val(),
				size : this.$('input[name=size]').val()
			});

		}

	});

});